package com.zhoutao123.hephaestus.repository;

import com.zhoutao123.hephaestus.repository.dao.BlogCommentMapper;
import com.zhoutao123.hephaestus.repository.entity.BlogComment;
import com.zhoutao123.hephaestus.repository.entity.BlogCommentExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class BlogCommentRepo
        extends MyBatisGeneratedRepo<
        BlogCommentExample, BlogCommentExample.Criteria, BlogComment, BlogComment> {

    @Autowired
    private BlogCommentMapper mapper;

    @Override
    Mapper<BlogCommentExample, BlogComment, BlogComment> getMapper() {
        return new Mapper<BlogCommentExample, BlogComment, BlogComment>() {
            @Override
            public long countByExample(BlogCommentExample blogCommentExample) {
                return mapper.countByExample(blogCommentExample);
            }

            @Override
            public int insert(BlogComment blogComment) {
                return mapper.insertSelective(blogComment);
            }

            @Override
            public int insertSelective(BlogComment blogComment) {
                return mapper.insertSelective(blogComment);
            }

            @Override
            public int deleteByExample(BlogCommentExample blogCommentExample) {
                return mapper.deleteByExample(blogCommentExample);
            }

            @Override
            public int updateByPrimaryKey(BlogComment blogComment) {
                return mapper.updateByPrimaryKey(blogComment);
            }

            @Override
            public int updateByPrimaryKeySelective(BlogComment blogComment) {
                return mapper.updateByPrimaryKeySelective(blogComment);
            }

            @Override
            public int updateByExample(BlogComment blogComment, BlogCommentExample blogCommentExample) {
                return mapper.updateByExample(blogComment, blogCommentExample);
            }

            @Override
            public int updateByExampleSelective(
                    BlogComment blogComment, BlogCommentExample blogCommentExample) {
                return mapper.updateByExampleSelective(blogComment, blogCommentExample);
            }

            @Override
            public List<BlogComment> selectByExample(BlogCommentExample blogCommentExample) {
                return mapper.selectByExample(blogCommentExample);
            }
        };
    }

    @Override
    BlogCommentExample createExample() {
        return new BlogCommentExample();
    }

    @Override
    BlogCommentExample.Criteria createCriteria(BlogCommentExample blogCommentExample) {
        return blogCommentExample.createCriteria();
    }
}
